<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="美国,欧美,游戏专线独享EB,socks5代理IP,proxy"/>
<meta name="description" content="socks5自由在线提取系统，出售包日EB，S5代理，包月独享专线，保证独享专线一个IP一个人使用，大量proxy" />
<title>无标题文档</title>
<style type="text/css">
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}

.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}

.STYLE6 {
	color: #000000;
	font-size: 14px;
}

.STYLE10 {
	color: #000000;
	font-size: 12px;
}

.STYLE19 {
	color: #344b50;
	font-size: 12px;
}

.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}

.STYLE22 {
	font-size: 12px;
	color: #295568;
}

.buylink{
	text-decoration: none;
	color: #000000;
}

.up{}

input.error { border: 1px solid red; }
</style>
<script type="text/javascript" src="<%=path%>/js/jquery-1.4.3.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery.validate.js"></script>
<script type="text/javascript">
	function pagebuy(o){
		var no = $('#pageNo').val();
		var reg =/^[0-9]+$/ig;
		if(reg.test(no)){
			if(no>o||no<1){
				alert("输入正确的页码！");
				return false;
			}
			return true;
		}
		return false;
	}
	function update(id) {
		if(confirm("确定要修改吗?")) {
			document.getElementById("update"+id).submit();
		}
	}
	function updateState(id) {
		if(confirm("确定要发布到首页吗?")) {
			document.getElementById("updateState"+id).submit();
		}
	}
	function delNews(id) {
		if(confirm("确定要删除吗?")) {
			document.getElementById("delForm"+id).submit();
		}
	}
</script>
</head>

<body>
	<table width="100%" border="0" align="center" cellpadding="0"
		cellspacing="0">
		<tr>
			<td height="30"><table width="100%" border="0" cellspacing="0"
					cellpadding="0">
					<tr>
						<td height="24" bgcolor="#353c44"><table width="100%"
								border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td><table width="100%" border="0" cellspacing="0"
											cellpadding="0">
											<tr>
												<td height="19" width="100px" valign="bottom"><img
													src="<%=path%>/images/tb.gif" width="14" height="14" /><span
													style="vertical-align: middle;" class="STYLE1">
														新闻列表</span>
												</td>
												<td>
													<form action="<%=path%>/admin/goToAddNewsPage.do" method="post" >
														<input type="submit"  value="新增"/>
													</form>
												</td>
											</tr>
										</table></td>
									<td>&nbsp;</td>
								</tr>
							</table></td>
					</tr>
				</table></td>
		</tr>
		<tr>
			<td>&nbsp;</td>
		</tr>

		<tr>
			<td><table width="100%" border="0" cellpadding="0"
					cellspacing="1" bgcolor="#a8c7ce">
					<tr>
						<td width="4%" height="20" bgcolor="d3eaef" class="STYLE10"><div
								align="center">
								<span class="STYLE10">No.</span>
							</div></td>
						<td width="20%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">标题</span>
							</div></td>
						<td width="20%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">内容</span>
							</div></td>
						<td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">创建时间</span>
							</div></td>
						<td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div
							align="center">
							<span class="STYLE10">状态</span>
						</div></td>
						<td colspan="3" width="22%" height="20" bgcolor="d3eaef" class="STYLE6"><div
							align="center" >
							<span class="STYLE10">操作</span>
						</div></td>
					</tr>
					<tbody>
						<s:iterator value="page.result" var="p" status="s">
								<tr>
									<td height="20" bgcolor="#FFFFFF">
										<div align="center">
											<s:property value="#s.count"/>
										</div>
									</td>
									<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
											align="center">
											<span><s:property value="#p.title"/></span>
										</div></td>
									<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										<span><s:property value="#p.text"/></span>
									</div></td>
									<td height="20" bgcolor="#FFFFFF" class="STYLE19">
									<div align="center">
										<span><s:property value="#p.createdate"/></span>
									</div></td>
									<s:if test="#p.type==0">
										<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
											align="center">
												<span style="color:green">未发布</span>
										</div></td>
									</s:if>
									<s:else>
										<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
											align="center">
												<span style="color:red">已发布</span>
										</div></td>
									</s:else>
									<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">
										<table><tr><td>
										<form id="update<s:property value="#p.id"/>" action="<%=path%>/admin/goToAddNewsPage.do" method="post">
											<input type="hidden" name="news.id" value="<s:property value="#p.id"/>"/>
											<input type="hidden" name="news.type" value="<s:property value="#p.type"/>"/>
											<input type="hidden" name="news.context" value="<s:property value="#p.context"/>"></input>
											<input type="hidden" name="news.title" value="<s:property value="#p.title"/>"></input>
											<input type="hidden" name="news.createdate" value="<s:property value="#p.createdate"/>"></input>
											<a href="#" onclick="update(<s:property value="#p.id"/>);">更改</a>|&nbsp;&nbsp;
										</form>
										</td><td>
										<form id="updateState<s:property value="#p.id"/>" action="<%=path%>/admin/updateNewsState.do" method="post">
											<input type="hidden" name="news.id" value="<s:property value="#p.id"/>"/>
											<a href="#" onclick="updateState(<s:property value="#p.id"/>)">发布</a>
										</form>
										</td><td>	
										<form id="delForm<s:property value="#p.id"/>" action="<%=path%>/admin/delNews.do" method="post">
											<input type="hidden" name="news.id" value="<s:property value="#p.id"/>"/>
											<a href="#" onclick="delNews(<s:property value="#p.id"/>)">删除</a>|&nbsp;&nbsp;
										</form>
										</td></tr></table>		
									</div></td>
								</tr>
						</s:iterator>
						
					</tbody>
				</table></td>
		</tr>
		<tr>
			<td height="30"><table width="100%" border="0" cellspacing="0"
					cellpadding="0">
					<tr bgcolor="d3eaef">
						<td width="33%"><div align="left">
								<span class="STYLE22">&nbsp;&nbsp;&nbsp;&nbsp;Total:
								<strong> <s:property value="page.totalCount" /></strong> page  
								<strong><s:property value="page.currentPageNo" /></strong> of&nbsp;   
								<strong> <s:property value="page.lastPageNo" /> </strong> PageSize:
								<strong><s:property value="pageSize" /></strong>
								</span>
							</div></td>
						<td width="67%">
							<table width="312" border="0" align="right" cellpadding="0"
								cellspacing="0">
								<tr>
									<s:if test="1==page.currentPageNo">
										<td width="49" align="center">
												<input style="border-color: #EEEEFF; border: 0px;"
													type="button" disabled="disabled" value="First" />
											</td>
									</s:if>
									<s:else>
										<td width="49" align="center">
												<a href="<%=path%>/admin/pageNews.do?pageNo=1"><input
													style="border-color: #EEEEFF; border: 0px;" type="button"
													value="First" /></a>
											</td>
									</s:else>
									<s:if test="page.hasPrevPage()">
										<td width="49" align="center">
												<a
													href="<%=path%>/admin/pageNews.do?pageNo=<s:property value="pageNo-1"/>"><input
													style="border-color: #EEEEFF; border: 0px;" type="button"
													value="Prev" /></a>
											</td>
									</s:if>
									<s:else>
										<td width="49" align="center">
												<input style="border-color: #EEEEFF; border: 0px;"
													type="button" disabled="disabled" value="Prev" />
											</td>
									</s:else>
									<s:if test="page.hasNextPage()">
										<td width="49" align="center">
												<a href="<%=path%>/admin/pageNews.do?pageNo=<s:property value="page.lastPageNo"/>"><input
													style="border-color: #EEEEFF; border: 0px;" type="button"
													value="Next" /></a>
											</td>
									</s:if>
									<s:else>
										<td width="49" align="center">
												<input style="border-color: #EEEEFF; border: 0px;"
													type="button" disabled="disabled" value="Next" />
										</td>
									</s:else>
									<s:if test="page.currentPageNo==page.lastPageNo||page.lastPageNo==0">
										<td width="49" align="center">
												<input style="border-color: #EEEEFF; border: 0px;"
													type="button" disabled="disabled" value="Last" />
										</td>
									</s:if>
									<s:else>
										<td width="49" align="center">
												<a href="<%=path%>/admin/pageNews.do?pageNo=<s:property value="page.lastPageNo"/>"><input
													style="border-color: #EEEEFF; border: 0px;" type="button"
													value="Last" /></a>
										</td>
									</s:else>
									<td width="37" class="STYLE22"><div align="center">Go</div></td>
									<td colspan="3" width="97">
										<form action="<%=path%>/admin/pageNews.do" method="post">
											<table>
												<tr>
													<td align="center">
															<input type="text" name="pageNo" id="pageNo"
																style="width: 20px; height: 12px; font-size: 12px; border: solid 1px #7aaebd;" />
													</td>
													<td width="22" class="STYLE22"><div align="center">&nbsp;page</div></td>
													<td width="35"><input type="submit" value="Go" style="border-color:#EEEEFF; border: 0px; margin-right: 10px;" onclick="return pagebuy(<s:property value="page.lastPageNo"/>)"></td>
												</tr>
											</table>
										</form>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table></td>
		</tr>
	</table>
</body>
</html>
